<%@ page contentType="text/html;charset=UTF-8" %>
<%@include file="/WEB-INF/jsp/common/taglibs.jspf"%>
<c:if test="${op eq '新增'}"><c:set var="icon" value="icon-file-alt"/></c:if>
<c:if test="${op eq '修改'}"><c:set var="icon" value="icon-edit"/></c:if>
<c:if test="${op eq '删除'}"><c:set var="icon" value="icon-trash"/></c:if>

<div class="page-content">
    <%--@elvariable id="m" type="com.bfl.sa.showcase.sample.entity.Sample"--%>
    <form:form id="editForm" method="post" commandName="m" cssClass="form-horizontal">
        <es:showGlobalError commandName="m"/>

        <form:hidden path="id"/>
        <form:hidden path="deleted"/>
        <div class="form-group">
            <form:label path="name" cssClass="col-sm-3 control-label no-padding-right">名称：</form:label>
            <div class="col-sm-9">
                <form:input path="name" cssClass="form-control input-sm validate[required,custom[username],ajax[ajaxNameCall]]" placeholder="5到10个字母、数字、下划线"/>
            </div>
        </div>
        <div class="form-group">
            <form:label path="age" cssClass="col-sm-3 control-label no-padding-right">年龄：</form:label>
            <div class="col-sm-9">
                <form:input path="age" cssClass="form-control input-sm validate[required,custom[integer]]" placeholder="请输入年龄"/>
            </div>
        </div>
        <div class="form-group">
            <form:label path="birthday"  cssClass="col-sm-3 control-label no-padding-right">出生日期：</form:label>
            <div class="col-sm-9">
                <span class="input-icon input-icon-right block">
                    <form:input path="birthday" id="birthday" cssClass="form-control input-sm validate[required]" placeholder="例如2013-02-07" readonly="true" />
                    <i class="ace-icon fa fa-calendar"></i>
                </span>
            </div>
        </div>
        <div class="form-group">
            <form:label path="sex"  cssClass="col-sm-3 control-label no-padding-right">性别：</form:label>
            <div class="col-sm-9">
                <form:select path="sex" cssClass="form-control input-sm validate[required] validate[required]">
                    <form:option label="请选择" value=""/>
                    <form:options items="${sexList}" itemLabel="info"/>
                </form:select>
            </div>
        </div>
        <div class="form-group">
            <form:label path="show" cssClass="col-sm-3 control-label no-padding-right">是否显示：</form:label>
            <div class="col-sm-9 radio">
                <form:radiobuttons path="show" items="${booleanList}" itemLabel="info" itemValue="value" cssClass="ace validate[required]"/>
            </div>
        </div>
        <div class="btn-group-sm center">
            <button id="btnSave" class="btn btn-info" type="submit">
                <i class="ace-icon fa ${icon}"></i> ${op}
            </button>&nbsp; &nbsp; &nbsp;
            <button class="btn" type="button" onclick="layer.closeAll()">
                <i class="ace-icon fa fa-undo"></i> 取消
            </button>
        </div>
    </form:form>
</div>
